﻿CREATE TABLE [dbo].[HospWardPatient]
(
	[Id] BIGINT IDENTITY(1,1) NOT NULL,
	[WxUserId] BIGINT NULL,
	[BkMemberId] BIGINT NULL,
	[WardNo] NVARCHAR(50) NOT NULL, 
	[PatientName] [nvarchar](50) NULL,
	[PatientId] NVARCHAR(50) NULL, 
    [Name] NVARCHAR(50) NULL, 
    [Gender] NVARCHAR(50) NULL, 
    [Age] NVARCHAR(50) NULL, 
    [Birthdate] NVARCHAR(50) NULL, 
    [IdenNo] NVARCHAR(50) NULL, 
    [Phone] NVARCHAR(50) NULL, 
    [FeeType] NVARCHAR(50) NULL, 
    [IsDefault] INT NULL DEFAULT 0, 
	[RecStatus] INT NOT NULL, 
    [RecCreateDt] DATETIME NOT NULL, 
    [RecUpdateDt] DATETIME NULL, 
    [RecDeleteDt] DATETIME NULL,
    CONSTRAINT [PK_HospWardPatient] PRIMARY KEY CLUSTERED ([Id] ASC)
)


GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录删除时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'RecDeleteDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'住院号',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'WardNo'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'住院号Id，自增列，主键',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'Id'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'微信用户Id',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'WxUserId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'倍康会员Id',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'BkMemberId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者姓名',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'PatientName'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者标识',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'PatientId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者名称',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'Name'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者性别',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'Gender'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者年龄',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'Age'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者出生日期 yyyy-MM-dd',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'Birthdate'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者身份证号',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'IdenNo'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者联系电话',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'Phone'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'患者费别 自费或者公费',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'FeeType'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'是否默认住院号； 1-默认，0-非默认',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'IsDefault'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录状态, 1：正常；2：删除',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'RecStatus'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录创建时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'RecCreateDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录上次修改时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospWardPatient',
    @level2type = N'COLUMN',
    @level2name = N'RecUpdateDt'